package org.example.domain;

import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;

@ApiModel(description = "秒杀活动")
@Data
@TableName("seckill_activity")
public class SeckillActivity {
    @TableId(value = "activity_id", type = IdType.AUTO)
    @ApiModelProperty(value = "活动ID")
    private Long activityId;

    @TableField("prod_id")
    @ApiModelProperty(value = "商品ID")
    private Long prodId;

    @TableField("sku_id")
    @ApiModelProperty(value = "skuID")
    private Long skuId;

    @TableField("start_time")
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "开始时间")
    private Date startTime;

    @TableField("end_time")
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "结束时间")
    private Date endTime;

    @TableField("total_stock")
    @ApiModelProperty(value = "总库存")
    private Integer totalStock;

    @TableField("available_stock")
    @ApiModelProperty(value = "可用库存")
    private Integer availableStock;

    @TableField("sec_price")
    @ApiModelProperty(value = "秒杀价格")
    private BigDecimal secPrice;

    @TableField("status")
    @ApiModelProperty(value = "状态：1-未开始 2-进行中 3-已结束 4-已下架")
    private Integer status;

    @TableField("version")
    @Version
    @ApiModelProperty(value = "乐观锁版本号")
    private Integer version;

    @TableField("create_time")
    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @TableField("update_time")
    @ApiModelProperty(value = "更新时间")
    private Date updateTime;

    //数据库表中不存在的字段
    @TableField(exist = false)
    @ApiModelProperty(value = "商品名称")
    private String prodName;

    @TableField(exist = false)
    @ApiModelProperty(value = "商品图片")
    private String pic;

    @TableField(exist = false)
    @ApiModelProperty(value = "商品价格")
    private BigDecimal price;

    @TableField(exist = false)
    @ApiModelProperty(value = "折扣")
    private BigDecimal countdown;

}